/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: dpaa eth driver Vendor Hooks
 */

#ifdef CONFIG_NETBIOS_FSL_FMAN_SPEC

#ifndef DPAA_FMAN_MAC_EXT_H
#define DPAA_FMAN_MAC_EXT_H
#include "fman_mac.h"
#include "mac.h"
struct mac_device_ext {
	struct mac_device		mac_dev;
	void __iomem			*vaddr;
	int (*dump_mac_regs)(struct fman_mac *mac_dev, char *buf, int nn);
	int (*dump_mac_rx_stats)(struct fman_mac *mac_dev, char *buf, int nn);
	int (*dump_mac_tx_stats)(struct fman_mac *mac_dev, char *buf, int nn);
};

int memac_dump_regs(struct fman_mac *memac, char *buf, int nn);
int memac_dump_regs_rx(struct fman_mac *memac, char *buf, int nn);
int memac_dump_regs_tx(struct fman_mac *memac, char *buf, int nn);
bool fsl_memac_can_read_reg(struct fman_mac *memac);
u32 fsl_memac_read_reg(struct fman_mac *memac, unsigned int regoff);

void trace_dpaa_fman_mac_fixed_init(struct fman_mac *memac, phy_interface_t phy_if,
	struct fixed_phy_status *fixed_link);
int trace_mac_probe_alloc_dev(struct device *dev, struct mac_device **mac_dev);
void trace_mac_probe_set_drvdata(struct device *dev, struct mac_device *mac_dev,
		void __iomem *vaddr);
#endif

#else

struct fman_mac;
struct fixed_phy_status;
struct device;
struct mac_device;

static inline void trace_dpaa_fman_mac_fixed_init(struct fman_mac *memac,
				phy_interface_t phy_if, struct fixed_phy_status *fixed_link)
{
}

static inline int trace_mac_probe_alloc_dev(struct device *dev,
									struct mac_device **mac_dev)
{
	return 0;
}

static inline void trace_mac_probe_set_drvdata(struct device *dev,
				struct mac_device *mac_dev, void __iomem *vaddr)
{
}
#endif
